load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "conflictedkv",
    srcs = [
        "handler.go",
        "row_handle.go",
    ],
    importpath = "github.com/pingcap/tidb/pkg/disttask/importinto/conflictedkv",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/executor/importer",
        "//pkg/kv",
        "//pkg/lightning/backend/external",
        "//pkg/lightning/backend/kv",
        "//pkg/lightning/common",
        "//pkg/meta/model",
        "//pkg/table",
        "//pkg/table/tables",
        "//pkg/tablecodec",
        "//pkg/types",
        "//pkg/util/redact",
        "@com_github_docker_go_units//:go-units",
        "@com_github_pingcap_errors//:errors",
        "@com_github_pingcap_failpoint//:failpoint",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "conflictedkv_test",
    timeout = "short",
    srcs = [
        "handler_test.go",
        "row_handle_test.go",
    ],
    embed = [":conflictedkv"],
    flaky = True,
    shard_count = 3,
    deps = [
        "//pkg/config/kerneltype",
        "//pkg/executor/importer",
        "//pkg/kv",
        "//pkg/lightning/backend/encode",
        "//pkg/lightning/backend/external",
        "//pkg/lightning/backend/kv",
        "//pkg/parser/ast",
        "//pkg/session",
        "//pkg/table",
        "//pkg/tablecodec",
        "//pkg/testkit",
        "//pkg/types",
        "//pkg/util",
        "@com_github_stretchr_testify//require",
        "@org_uber_go_zap//:zap",
    ],
)
